#include "simpledoublylinkedlist.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void show(void* x){
	printf("%s\n", (char*)x);
}



int main (int argv, char** argc){
	SimpleDoublyLinkedList ls;
	SimpleDoublyLinkedListItem* lsi;

	lsi=ls.add_end(strdup("ninja1"));
	free(lsi->payload);
	ls.remove(lsi);

	lsi=ls.add_end(strdup("ninja1"));
	ls.move_to_end(lsi);
	ls.add_end(strdup("ninja2"));
	ls.add_end(strdup("ninja3"));
	ls.add_end(strdup("ninja4"));


	ls.show_all(show);	




	printf("-----\n");
	free(lsi->payload);
	ls.remove(lsi);
	ls.show_all(show);	

	printf("-----\n");
	lsi=ls.add_end(strdup("ninja5"));
	ls.show_all(show);	

	printf("-----\n");
	free(lsi->payload);
	ls.remove(lsi);
	ls.show_all(show);	

	ls.remove_all();
}

